package com.ytjj.quartz.utils;

import java.util.Map;

/**
 * @Description 快递字典
 * @ClassName ExpressDicUtil
 *
 * 
 * @Version 1.0
 **/

public class ExpressDicUtil {
    private static Map<String, String> expressDicMap;

    public ExpressDicUtil() {
    }

    /**
     * 放入map缓存
     */
    public static void putIntoMap(Map<String, String> map) {
        expressDicMap = map;
    }
    /**
     * 根据值获取value
     */
    public static String getValue(String key) {
        return expressDicMap.get(key);
    }

    /**
     * 是否包含key
     */
    public static Boolean isContainsKey(String key) {
        return expressDicMap.containsKey(key);
    }

    public static Boolean containKey(String key) {
        return expressDicMap.containsKey(key);
    }

    /**
     * 根据value获取key
     */
    public static String getKey(String value) {
        for (String key : expressDicMap.keySet()) {
            if(expressDicMap.get(key).equals(value)) {
                return key;
            }
        }
        return null;
    }
}